﻿@model IPagedListModel<ActivityReservation.Models.Notice>
@{
    Layout = null;
}
@if (Model.Data.Count() > 0)
{
<table class="table table-striped">
    <thead>
        <tr>
            <th>公告标题</th>
            <th>公告发布人</th>
            <th>公告更新时间</th>
            <th>公告发布时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.Data)
            {
        <tr class="@($"tr_{item.NoticeId:N}")">
            <td>
                @item.NoticeTitle
            </td>
            <td>
                @item.NoticePublisher
            </td>
            <td>
                @item.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")
            </td>
            <td>
                @item.NoticePublishTime.ToString("yyyy-MM-dd HH:mm:ss")
            </td>
            <td>
                <a href="/Notice/@item.NoticePath" target="_blank">查看</a> &nbsp;
                <button type="button" class="btn btn-danger" onclick="DeleteNotice('@item.NoticeId.ToString("N")')">删除</button>
            </td>
        </tr>
            }
    </tbody>
</table>
@Html.Pager(Model.Pager, pageIndex => $"javascript:loadData({pageIndex})", "PagerPartial", PagingDisplayMode.IfNeeded)
}
else
{
<div class="nodata-tip">
    暂时没有数据.
</div>
}